<template>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">项目变更</BaseHead>
    <el-table :data="detailData.bizProjectAlterationVoList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column prop="alterTypeName" label="变更类型" />
      <el-table-column prop="alterReason" label="变更原因" />
      <el-table-column prop="alterDate" label="变更时间" />
      <el-table-column label="审核状态">
        <template #default="{ row }">
          <CommonLabel
            :dataList="checkStatusList"
            valueKey="dictValue"
            labelKey="dictLabel"
            :value="row.checkstatus"
          />
        </template>
      </el-table-column>
    </el-table>
  </div>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">项目中检</BaseHead>
    <el-table :data="detailData.bizProjectMiddleCheckVoList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column prop="middleCheckDate" label="中检日期" />
      <el-table-column prop="zjNote" label="中检说明" />
      <el-table-column label="中检报告">
        <template #default="{ row }">
          <p v-if="row.fileId">
            {{ row.fileName }}
            <el-link
              type="primary"
              @click="handleDownload(row.fileId, row.fileName)"
              class="ml-[5px]"
              >下载</el-link
            >
          </p>
        </template>
      </el-table-column>
      <el-table-column prop="checkstatusName" label="审核状态 " />
    </el-table>
  </div>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">项目结项</BaseHead>
    <el-table :data="detailData.bizProjectCompleteVoList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column prop="completeDate" label="结项日期" />
      <el-table-column prop="jxNote" label="结项说明" />
      <el-table-column label="结项报告">
        <template #default="{ row }">
          <p v-if="row.fileId">
            {{ row.fileName }}
            <el-link
              type="primary"
              @click="handleDownload(row.fileId, row.fileName)"
              class="ml-[5px]"
              >下载</el-link
            >
          </p>
        </template>
      </el-table-column>
      <el-table-column prop="checkstatusName" label="审核状态" />
    </el-table>
  </div>
</template>

<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import CommonLabel from "@/views/project/components/CommonLabel.vue";
import { processDetail } from "@/api/project/zx/lxxm";
import { handleDownload } from "@/utils/main";
const checkStatusList = inject("checkStatusList");
const operateId = inject("id");
const detailData = ref({});
//获取信息详情
const getDetail = async () => {
  try {
    const res = await processDetail(operateId.value);
    detailData.value = res.data;
  } catch (error) {
    console.log(error);
  }
};
onMounted(() => {
  getDetail();
});
</script>

<style scoped lang="scss"></style>
